- params[:target_type] ||= "Product"

= field_set do
  - natures = Nomen::IssueNature.list
  - if variety = Nomen::Variety[params[:target_type].underscore]
    - natures = natures.select{|i| i.target and i.target.detect{|t| variety.include?(t)}}
  - if natures.empty?
    - natures = Nomen::IssueNature.list
  = f.input :nature, collection: natures.collect{|i| [i.human_name, i.name]}.sort{|a,b| a.first.ascii <=> b.first.ascii}
  = f.input :observed_at
  = f.input :target_id, as: :hidden
  = f.input :target_type, as: :hidden
  = f.picture
  = f.input :description, as: :text
  = f.input :priority, collection: 0..4, as: :radio_buttons
  = f.input :gravity, collection: 0..4, as: :radio_buttons
  - unless params[:without_geolocation].to_i > 0
    = f.geolocation
  = f.yes_no_radio :dead, label: "is_#{params[:target_type].to_s.downcase}_destroyed_by_this_issue".t(scope:[:killables]) if params[:target_type] and params[:target_type] == 'Plant'
  = f.custom_fields

= f.attachments_field_set

